﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Media.Animation;

namespace Dictionary.PresentationLayer
{
    /// <summary>
    /// Interaction logic for About.xaml
    /// </summary>
    public partial class About : Window
    {
        public About()
        {
            InitializeComponent();
        }

#region Function
        //ham goi effect cua cac nut min, max, close
        private void ControlButton(System.Windows.Controls.Image i, string s)
        {
            i.RenderTransformOrigin = new System.Windows.Point(0.5, 0.5);
            Storyboard stb = new Storyboard();
            stb = (Storyboard)Resources[s];
            i.BeginStoryboard(stb);
        }
#endregion

        private void imgClose_MouseEnter(object sender, MouseEventArgs e)
        {
            BitmapImage bi = new BitmapImage();
            bi.BeginInit();
            bi.UriSource = new Uri("../Image/Close_2.png", UriKind.Relative);
            bi.EndInit();
            ImageSource img = bi;
            imgClose.Source = img;
            ControlButton(imgClose, "ControlButton_Down");
        }

        private void imgClose_MouseLeave(object sender, MouseEventArgs e)
        {
            BitmapImage bi = new BitmapImage();
            bi.BeginInit();
            bi.UriSource = new Uri("../Image/Close.png", UriKind.Relative);
            bi.EndInit();
            ImageSource img = bi;
            imgClose.Source = img;
            ControlButton(imgClose, "ControlButton_Up");
        }

        private void imgClose_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            this.Close();
        }

        private void lblTitle_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            this.DragMove();
        }
    }
}
